<?php
/**
 * Created by a front-end programmer.
 * User: Xwen
 * Date: 2018/3/5
 * Time: 14:05
 * Mail:lauwencn@gmail.com
 */
class CommonController extends Controller{
    public function __init()
    {
        if(!isset($_GET['cid'])) $_GET['cid'] = 0;
        $hotData = K("Article")->limit(5)->order("click desc")->all();
        $this->assign('hotData', $hotData);

        $cateData = K('Category')->get_all();
        $this->assign('cateData', $cateData);
    }
}
